﻿using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Windows;
using MimiDouban.Player;
using MimiDouban.Abstract;
using doubanloginDll8;
using MimiDouban.Control;
using MimiDouban.Test;
using MimiDouban.SongProvider;
using MimiDouban.Abstract.Beans;
using MimiDouban.UI;
using MimiDouban.UI.HttpInputUI;
using MimiDouban.UI.SkinManager;
using MimiDouban.Extention;

namespace MimiDouban
{
    /// <summary>
    /// Interaction logic for App.xaml
    /// </summary>
    public partial class App : Application
    {
        /// <summary>
        /// 程序入口函数，主要的对象都在这里生成
        /// </summary>
        public App()
        {
            IMainUI main = new MainWindow();//主界面
            IInputUI hotkeyUi = new HotKeyInputUI();//快捷键输入界面
            IInputUI httpUi = new HttpInputUI();
            IOutputUI tipsUi = new TipsOutputUI((MainWindow)main);
            MainUIProxy mainStud = new MainUIProxy();//界面代理，所有界面由此代表
            mainStud.addMainUI(main);
            mainStud.addInputUI(hotkeyUi);
            mainStud.addInputUI(httpUi);
            mainStud.addOutputUI(tipsUi);

            mainStud.Channels = new DoubanChannel[] {
                new DoubanChannel("0","私人兆赫"),
	            new DoubanChannel("1","华语"),
	            new DoubanChannel("6","粤语"),
	            new DoubanChannel("2","欧美"),
	            new DoubanChannel("27","古典"),
	            new DoubanChannel("26","豆瓣音乐人"),
	            new DoubanChannel("22","法语"),
	            new DoubanChannel("17","日语"),
	            new DoubanChannel("18","韩语"),
	            new DoubanChannel("13","爵士"),
	            new DoubanChannel("14","电子"),
	            new DoubanChannel("16","R&B"),
	            new DoubanChannel("15","说唱"),
	            new DoubanChannel("7","摇滚"),
	            new DoubanChannel("8","民谣"),
	            new DoubanChannel("10","电影原声"),
	            new DoubanChannel("9","轻音乐"),
	            new DoubanChannel("20","女声"),
	            new DoubanChannel("3","七零"),
	            new DoubanChannel("4","八零"),
	            new DoubanChannel("5","九零"),
	            new DoubanChannel("28","动漫"),
	            new DoubanChannel("32","咖啡"),
	            new DoubanChannel("48","Who Next?!"),
	            new DoubanChannel("50","中国原创盛典"),
	            new DoubanChannel("51","K5经典乐赏")
            };

            IController controller = new Controller();
            controller.setMainUI(mainStud);
            controller.setPlayer(new NewAudioPlayer());
            controller.setSongProvider(new DoubanSongProvider());

            controller.start();
        }
    }
}